﻿using CheccCoverplateCulvertAssemble.Conmmon;
using CheccCoverplateCulvertAssemble.Entity;
using CheccCoverplateCulvertAssemble.Tools;
using CheccTexturePropertyGive;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static Bentley.CIMNET.CIMGeometry.Solid.SolidUtil.Modify;
using static CheccTexturePropertyGive.SetCoverCulvertTexture;

namespace CheccCoverplateCulvertAssemble.Operation
{
    internal class SeparatingBasicLeft : ConstructingEntity
    {
        public SeparatingBasicLeft(BasicConstructor basicConstructor,CulvertType culvertType, ConstructionMethod constructionMethod, CulvertComponentType culvertComponentType) : base(basicConstructor, culvertType, constructionMethod, culvertComponentType)
        {
        }

        public override void CreateEntityModel()
        {
            CreateBermLeft();
            CreateBermRight();
            CreateBasicsLeft();
            CreateBasicsRight();
        }

        private void CreateBermLeft()
        {
            var objParameter = GetUorCoverParameter();
            DPoint3d[] points =
            {
                new DPoint3d(0,(objParameter.clearSpan / 2 + objParameter.standPly)* GeneralBank.UorToMeters ,0),
                new DPoint3d(0,(objParameter.clearSpan / 2 + objParameter.standPly)* GeneralBank.UorToMeters,-(objParameter.piecePly + objParameter.clearHeight) * GeneralBank.UorToMeters),
                new DPoint3d(0,objParameter.clearSpan / 2 * GeneralBank.UorToMeters,-(objParameter.piecePly + objParameter.clearHeight) * GeneralBank.UorToMeters),
                new DPoint3d(0,objParameter.clearSpan / 2 * GeneralBank.UorToMeters,-(objParameter.piecePly) * GeneralBank.UorToMeters),
                new DPoint3d(0,(objParameter.clearSpan / 2 + objParameter.standPly -objParameter.standTopWidth ) * GeneralBank.UorToMeters,-(objParameter.piecePly) * GeneralBank.UorToMeters),
                new DPoint3d(0,(objParameter.clearSpan / 2 + objParameter.standPly -objParameter.standTopWidth ) * GeneralBank.UorToMeters,0),
                new DPoint3d(0,(objParameter.clearSpan / 2 + objParameter.standPly)* GeneralBank.UorToMeters ,0),
            };

            ShapeElement shapeElement = new ShapeElement(GeneralBank.ActiveDgnModel, null, points);
            CurveVector secCur = shapeElement.GetCurveVector();
            double LeftLateralOffset = Math.Abs((objParameter.standPly * 2 + objParameter.clearSpan + objParameter.basicsEdge * 2) * Math.Tan((90 - objParameter.leftLateralAngle) * Math.PI / 180));
            //涵长扣除城墙缝宽度
            double realLength = objParameter.culvertGapWidth / 2;

            LineElement lineElement = GetSlopLinee(DPoint3d.Zero, objParameter.basicsLength - realLength + LeftLateralOffset/2, objParameter.baseSlope, out DPoint3d slopeEndPT);
            CurveVector linePath = lineElement.GetCurveVector();
            SolidKernelEntity solidKernel = CreateBodyFromSweep(linePath, secCur, GeneralBank.ActiveDgnModel);

            double z = LeftLateralOffset / 2 * objParameter.baseSlope;
            DPoint3d movePoint3d = new DPoint3d(-LeftLateralOffset / 2, 0, -z) * GeneralBank.UorToMeters;
            DTransform3d trans = DTransform3d.Identity;
            trans.Translation = movePoint3d;
            TransformBody(ref solidKernel, trans);
            LineElement cutLine = null;
            CurveVector cutLinePath = null;

            if (objParameter.leftLateralAngle != 90)
            {
                if (objParameter.leftLateralAngle < 90)
                {
                    cutLine = new LineElement(GeneralBank.ActiveDgnModel, null, new DSegment3d(
                        new DPoint3d(-LeftLateralOffset / 2, -(objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge), 0) * GeneralBank.UorToMeters,
                        new DPoint3d(LeftLateralOffset / 2, (objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge), 0) * GeneralBank.UorToMeters));
                }
                else if (objParameter.leftLateralAngle > 90)
                {
                    cutLine = new LineElement(GeneralBank.ActiveDgnModel, null, new DSegment3d(
                        new DPoint3d(LeftLateralOffset / 2, -(objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge), 0) * GeneralBank.UorToMeters,
                        new DPoint3d(-LeftLateralOffset / 2, (objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge), 0) * GeneralBank.UorToMeters));
                }
                cutLinePath = cutLine.GetCurveVector();
                Bentley.CIMNET.CIMGeometry.Solid.SolidUtil.Modify.CutSolidsWithCurves(out SolidKernelEntity[] solidKernels, solidKernel, cutLinePath, SolidCutMethod.Split, SolidCutDirection.Both, SolidCutMode.Through, 0);
                solidKernel = solidKernels[0];
            }
            Convert1.BodyToElement(out Element cutResultElement, solidKernel, null, GeneralBank.ActiveDgnModel);

            //真实位置
            DTransform3d dTransform = new DTransform3d(this.dMatrix3D);
            dTransform.Translation = this.placeDpoint3d * GeneralBank.UorToMeters;
            TransformInfo dTransFormInfo = new TransformInfo(dTransform);
            cutResultElement.ApplyTransform(dTransFormInfo);
            cutResultElement.AddToModel();

            //属性赋予
            SetCoverCulvertECProperty setCoverCulvertECProperty = new SetCoverCulvertECProperty();
            setCoverCulvertECProperty.SetWallECProperty(
                new List<Element> { cutResultElement },
                objParameter.basicsLength.ToString(),
                (objParameter.piecePly + objParameter.clearHeight + objParameter.basicsPly).ToString(),
                objParameter.standTopWidth.ToString(),
                (objParameter.standPly * 2 + objParameter.clearSpan + objParameter.basicsEdge * 2).ToString(),
                0.ToString(),
                "",
                ""
                );
            //材质赋予
            SetCoverCulvertTexture setCoverCulvertTexture = new SetCoverCulvertTexture();
            setCoverCulvertTexture.CoverCulvertTexture(cutResultElement, CoverCulvertConstruction.WallBody);
            //工程数量
            FormColl.Assemble.SetTableData("台身", "混凝土", GeneralHelpers.GetCSVDatas("墙身")["混凝土等级"], SetCoverCulvertECProperty.GetVolume(cutResultElement, Bentley.MstnPlatformNET.InteropServices.Utilities.ComApp), "m³");
        }
        private void CreateBermRight()
        {
            var objParameter = GetUorCoverParameter();
            DPoint3d[] points =
            {
                new DPoint3d(0,-(objParameter.clearSpan / 2 + objParameter.standPly)* GeneralBank.UorToMeters ,0),
                new DPoint3d(0,-(objParameter.clearSpan / 2 + objParameter.standPly)* GeneralBank.UorToMeters,-(objParameter.piecePly + objParameter.clearHeight) * GeneralBank.UorToMeters),
                new DPoint3d(0,-objParameter.clearSpan / 2 * GeneralBank.UorToMeters,-(objParameter.piecePly + objParameter.clearHeight) * GeneralBank.UorToMeters),
                new DPoint3d(0,-objParameter.clearSpan / 2 * GeneralBank.UorToMeters,-(objParameter.piecePly) * GeneralBank.UorToMeters),
                new DPoint3d(0,-(objParameter.clearSpan / 2 + objParameter.standPly -objParameter.standTopWidth ) * GeneralBank.UorToMeters,-(objParameter.piecePly) * GeneralBank.UorToMeters),
                new DPoint3d(0,-(objParameter.clearSpan / 2 + objParameter.standPly -objParameter.standTopWidth ) * GeneralBank.UorToMeters,0),
                new DPoint3d(0,-(objParameter.clearSpan / 2 + objParameter.standPly)* GeneralBank.UorToMeters ,0),
            };
            ShapeElement shapeElement = new ShapeElement(GeneralBank.ActiveDgnModel, null, points);
            CurveVector secCur = shapeElement.GetCurveVector();
            double LeftLateralOffset = Math.Abs((objParameter.standPly * 2 + objParameter.clearSpan + objParameter.basicsEdge * 2) * Math.Tan((90 - objParameter.leftLateralAngle) * Math.PI / 180));
            //涵长扣除城墙缝宽度
            double realLength = objParameter.culvertGapWidth / 2;

            LineElement lineElement = GetSlopLinee(DPoint3d.Zero, objParameter.basicsLength - realLength + LeftLateralOffset / 2, objParameter.baseSlope, out DPoint3d slopeEndPT);
            CurveVector linePath = lineElement.GetCurveVector();
            SolidKernelEntity solidKernel = CreateBodyFromSweep(linePath, secCur, GeneralBank.ActiveDgnModel);

            double z = LeftLateralOffset / 2 * objParameter.baseSlope;
            DPoint3d movePoint3d = new DPoint3d(-LeftLateralOffset / 2, 0, -z) * GeneralBank.UorToMeters;
            DTransform3d trans = DTransform3d.Identity;
            trans.Translation = movePoint3d;
            TransformBody(ref solidKernel, trans);
            LineElement cutLine = null;
            CurveVector cutLinePath = null;
            if (objParameter.leftLateralAngle != 90)
            {
                if (objParameter.leftLateralAngle < 90)
                {
                    cutLine = new LineElement(GeneralBank.ActiveDgnModel, null, new DSegment3d(
                        new DPoint3d(-LeftLateralOffset / 2, -(objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge), 0) * GeneralBank.UorToMeters,
                        new DPoint3d(LeftLateralOffset / 2, (objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge), 0) * GeneralBank.UorToMeters));
                }
                else if (objParameter.leftLateralAngle > 90)
                {
                    cutLine = new LineElement(GeneralBank.ActiveDgnModel, null, new DSegment3d(
                        new DPoint3d(LeftLateralOffset / 2, -(objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge), 0) * GeneralBank.UorToMeters,
                        new DPoint3d(-LeftLateralOffset / 2, (objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge), 0) * GeneralBank.UorToMeters));
                }
                cutLinePath = cutLine.GetCurveVector();
                Bentley.CIMNET.CIMGeometry.Solid.SolidUtil.Modify.CutSolidsWithCurves(out SolidKernelEntity[] solidKernels, solidKernel, cutLinePath, SolidCutMethod.Split, SolidCutDirection.Both, SolidCutMode.Through, 0);
                solidKernel = solidKernels[0];
            }

            Convert1.BodyToElement(out Element cutResultElement, solidKernel, null, GeneralBank.ActiveDgnModel);

            //真实位置
            DTransform3d dTransform = new DTransform3d(this.dMatrix3D);
            dTransform.Translation = this.placeDpoint3d * GeneralBank.UorToMeters;
            TransformInfo dTransFormInfo = new TransformInfo(dTransform);
            cutResultElement.ApplyTransform(dTransFormInfo);
            cutResultElement.AddToModel();

            //属性赋予
            SetCoverCulvertECProperty setCoverCulvertECProperty = new SetCoverCulvertECProperty();
            setCoverCulvertECProperty.SetWallECProperty(
                new List<Element> { cutResultElement },
                objParameter.basicsLength.ToString(),
                (objParameter.piecePly + objParameter.clearHeight + objParameter.basicsPly).ToString(),
                objParameter.standTopWidth.ToString(),
                (objParameter.standPly * 2 + objParameter.clearSpan + objParameter.basicsEdge * 2).ToString(),
                0.ToString(),
                "",
                ""
                );
            //材质赋予
            SetCoverCulvertTexture setCoverCulvertTexture = new SetCoverCulvertTexture();
            setCoverCulvertTexture.CoverCulvertTexture(cutResultElement, CoverCulvertConstruction.WallBody);
            //工程数量
            FormColl.Assemble.SetTableData("台身", "混凝土", GeneralHelpers.GetCSVDatas("墙身")["混凝土等级"], SetCoverCulvertECProperty.GetVolume(cutResultElement, Bentley.MstnPlatformNET.InteropServices.Utilities.ComApp), "m³");
        }
        private void CreateBasicsLeft()
        {
            var objParameter = GetUorCoverParameter();
            DPoint3d[] points =
            {
                new DPoint3d(0,(objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge )* GeneralBank.UorToMeters,-(objParameter.piecePly + objParameter.clearHeight) * GeneralBank.UorToMeters),
                new DPoint3d(0,(objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge )* GeneralBank.UorToMeters,-(objParameter.piecePly + objParameter.clearHeight + objParameter.basicsPly) * GeneralBank.UorToMeters),
                new DPoint3d(0,(objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge - objParameter.basicsWidth )* GeneralBank.UorToMeters,-(objParameter.piecePly + objParameter.clearHeight + objParameter.basicsPly) * GeneralBank.UorToMeters),
                new DPoint3d(0,(objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge - objParameter.basicsWidth )* GeneralBank.UorToMeters,-(objParameter.piecePly + objParameter.clearHeight) * GeneralBank.UorToMeters),
                new DPoint3d(0,(objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge )* GeneralBank.UorToMeters,-(objParameter.piecePly + objParameter.clearHeight) * GeneralBank.UorToMeters)
            };

            ShapeElement shapeElement = new ShapeElement(GeneralBank.ActiveDgnModel, null, points);
            CurveVector secCur = shapeElement.GetCurveVector();
            double LeftLateralOffset = Math.Abs((objParameter.standPly * 2 + objParameter.clearSpan + objParameter.basicsEdge * 2) * Math.Tan((90 - objParameter.leftLateralAngle) * Math.PI / 180));
            //涵长扣除城墙缝宽度
            double realLength = objParameter.culvertGapWidth / 2;

            LineElement lineElement = GetSlopLinee(DPoint3d.Zero, objParameter.basicsLength - realLength + LeftLateralOffset / 2, objParameter.baseSlope, out DPoint3d slopeEndPT);
            CurveVector linePath = lineElement.GetCurveVector();
            SolidKernelEntity solidKernel = CreateBodyFromSweep(linePath, secCur, GeneralBank.ActiveDgnModel);

            double z = LeftLateralOffset / 2 * objParameter.baseSlope;
            DPoint3d movePoint3d = new DPoint3d(-LeftLateralOffset / 2, 0, -z) * GeneralBank.UorToMeters;
            DTransform3d trans = DTransform3d.Identity;
            trans.Translation = movePoint3d;
            TransformBody(ref solidKernel, trans);
            LineElement cutLine = null;
            CurveVector cutLinePath = null;
            if (objParameter.leftLateralAngle != 90)
            {
                if (objParameter.leftLateralAngle < 90)
                {
                    cutLine = new LineElement(GeneralBank.ActiveDgnModel, null, new DSegment3d(
                        new DPoint3d(-LeftLateralOffset / 2, -(objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge), 0) * GeneralBank.UorToMeters,
                        new DPoint3d(LeftLateralOffset / 2, (objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge), 0) * GeneralBank.UorToMeters));
                }
                else if (objParameter.leftLateralAngle > 90)
                {
                    cutLine = new LineElement(GeneralBank.ActiveDgnModel, null, new DSegment3d(
                        new DPoint3d(LeftLateralOffset / 2, -(objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge), 0) * GeneralBank.UorToMeters,
                        new DPoint3d(-LeftLateralOffset / 2, (objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge), 0) * GeneralBank.UorToMeters));
                }
                cutLinePath = cutLine.GetCurveVector();
                Bentley.CIMNET.CIMGeometry.Solid.SolidUtil.Modify.CutSolidsWithCurves(out SolidKernelEntity[] solidKernels, solidKernel, cutLinePath, SolidCutMethod.Split, SolidCutDirection.Both, SolidCutMode.Through, 0);
                solidKernel = solidKernels[0];
            }
            Convert1.BodyToElement(out Element cutResultElement, solidKernel, null, GeneralBank.ActiveDgnModel);

            //真实位置
            DTransform3d dTransform = new DTransform3d(this.dMatrix3D);
            dTransform.Translation = this.placeDpoint3d * GeneralBank.UorToMeters;
            TransformInfo dTransFormInfo = new TransformInfo(dTransform);
            cutResultElement.ApplyTransform(dTransFormInfo);
            cutResultElement.AddToModel();

            //属性赋予
            SetCoverCulvertECProperty setCoverCulvertECProperty = new SetCoverCulvertECProperty();
            setCoverCulvertECProperty.SetWallECProperty(
                new List<Element> { cutResultElement },
                objParameter.basicsLength.ToString(),
                (objParameter.piecePly + objParameter.clearHeight + objParameter.basicsPly).ToString(),
                objParameter.standTopWidth.ToString(),
                (objParameter.standPly * 2 + objParameter.clearSpan + objParameter.basicsEdge * 2).ToString(),
                0.ToString(),
                "",
                ""
                );
            //材质赋予
            SetCoverCulvertTexture setCoverCulvertTexture = new SetCoverCulvertTexture();
            setCoverCulvertTexture.CoverCulvertTexture(cutResultElement, CoverCulvertConstruction.WallBody);
            //工程数量
            FormColl.Assemble.SetTableData("基础", "混凝土", GeneralHelpers.GetCSVDatas("基础")["混凝土等级"], SetCoverCulvertECProperty.GetVolume(cutResultElement, Bentley.MstnPlatformNET.InteropServices.Utilities.ComApp), "m³");
        }
        private void CreateBasicsRight()
        {
            var objParameter = GetUorCoverParameter();
            DPoint3d[] points =
            {
                new DPoint3d(0,-(objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge )* GeneralBank.UorToMeters,-(objParameter.piecePly + objParameter.clearHeight) * GeneralBank.UorToMeters),
                new DPoint3d(0,-(objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge )* GeneralBank.UorToMeters,-(objParameter.piecePly + objParameter.clearHeight + objParameter.basicsPly) * GeneralBank.UorToMeters),
                new DPoint3d(0,-(objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge - objParameter.basicsWidth )* GeneralBank.UorToMeters,-(objParameter.piecePly + objParameter.clearHeight + objParameter.basicsPly) * GeneralBank.UorToMeters),
                new DPoint3d(0,-(objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge - objParameter.basicsWidth )* GeneralBank.UorToMeters,-(objParameter.piecePly + objParameter.clearHeight) * GeneralBank.UorToMeters),
                new DPoint3d(0,-(objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge )* GeneralBank.UorToMeters,-(objParameter.piecePly + objParameter.clearHeight) * GeneralBank.UorToMeters)
            };

            ShapeElement shapeElement = new ShapeElement(GeneralBank.ActiveDgnModel, null, points);
            CurveVector secCur = shapeElement.GetCurveVector();

            double LeftLateralOffset = Math.Abs((objParameter.standPly * 2 + objParameter.clearSpan + objParameter.basicsEdge * 2) * Math.Tan((90 - objParameter.leftLateralAngle) * Math.PI / 180));
            //涵长扣除城墙缝宽度
            double realLength = objParameter.culvertGapWidth / 2;

            LineElement lineElement = GetSlopLinee(DPoint3d.Zero, objParameter.basicsLength - realLength + LeftLateralOffset / 2, objParameter.baseSlope, out DPoint3d slopeEndPT);
            CurveVector linePath = lineElement.GetCurveVector();
            SolidKernelEntity solidKernel = CreateBodyFromSweep(linePath, secCur, GeneralBank.ActiveDgnModel);

            double z = LeftLateralOffset / 2 * objParameter.baseSlope;
            DPoint3d movePoint3d = new DPoint3d(-LeftLateralOffset / 2, 0, -z) * GeneralBank.UorToMeters;
            DTransform3d trans = DTransform3d.Identity;
            trans.Translation = movePoint3d;
            TransformBody(ref solidKernel, trans);
            LineElement cutLine = null;
            CurveVector cutLinePath = null;

            if (objParameter.leftLateralAngle != 90)
            {
                if (objParameter.leftLateralAngle < 90)
                {
                    cutLine = new LineElement(GeneralBank.ActiveDgnModel, null, new DSegment3d(
                        new DPoint3d(-LeftLateralOffset / 2, -(objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge), 0) * GeneralBank.UorToMeters,
                        new DPoint3d(LeftLateralOffset / 2, (objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge), 0) * GeneralBank.UorToMeters));
                }
                else if (objParameter.leftLateralAngle > 90)
                {
                    cutLine = new LineElement(GeneralBank.ActiveDgnModel, null, new DSegment3d(
                        new DPoint3d(LeftLateralOffset / 2, -(objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge), 0) * GeneralBank.UorToMeters,
                        new DPoint3d(-LeftLateralOffset / 2, (objParameter.clearSpan / 2 + objParameter.standPly + objParameter.basicsEdge), 0) * GeneralBank.UorToMeters));
                }
                cutLinePath = cutLine.GetCurveVector();
                Bentley.CIMNET.CIMGeometry.Solid.SolidUtil.Modify.CutSolidsWithCurves(out SolidKernelEntity[] solidKernels, solidKernel, cutLinePath, SolidCutMethod.Split, SolidCutDirection.Both, SolidCutMode.Through, 0);
                solidKernel = solidKernels[0];
            }
            Convert1.BodyToElement(out Element cutResultElement, solidKernel, null, GeneralBank.ActiveDgnModel);

            //真实位置
            DTransform3d dTransform = new DTransform3d(this.dMatrix3D);
            dTransform.Translation = this.placeDpoint3d * GeneralBank.UorToMeters;
            TransformInfo dTransFormInfo = new TransformInfo(dTransform);
            cutResultElement.ApplyTransform(dTransFormInfo);
            cutResultElement.AddToModel();

            //属性赋予
            SetCoverCulvertECProperty setCoverCulvertECProperty = new SetCoverCulvertECProperty();
            setCoverCulvertECProperty.SetWallECProperty(
                new List<Element> { cutResultElement },
                objParameter.basicsLength.ToString(),
                (objParameter.piecePly + objParameter.clearHeight + objParameter.basicsPly).ToString(),
                objParameter.standTopWidth.ToString(),
                (objParameter.standPly * 2 + objParameter.clearSpan + objParameter.basicsEdge * 2).ToString(),
                0.ToString(),
                "",
                ""
                );
            //材质赋予
            SetCoverCulvertTexture setCoverCulvertTexture = new SetCoverCulvertTexture();
            setCoverCulvertTexture.CoverCulvertTexture(cutResultElement, CoverCulvertConstruction.WallBody);
            //工程数量
            FormColl.Assemble.SetTableData("基础", "混凝土", GeneralHelpers.GetCSVDatas("基础")["混凝土等级"], SetCoverCulvertECProperty.GetVolume(cutResultElement, Bentley.MstnPlatformNET.InteropServices.Utilities.ComApp), "m³");
        }

        /// <summary>
        /// 获取分离式洞身构造参数
        /// </summary>
        /// <returns> 涵长,左偏角,右偏角,涵身沉降缝宽度,基础沉降缝宽度,涵底坡度, 净跨,净高,挡块高度,基础襟边,台身厚度,基础宽度,台身顶宽,基础厚度,净保护层</returns>
        /// 
        private (double basicsLength, double leftLateralAngle, double rightLateralAngle, double culvertGapWidth, double baseGapWidth, double baseSlope, double clearSpan, double clearHeight,
            double piecePly, double basicsEdge, double standPly,double basicsWidth, double standTopWidth, double basicsPly, double protectiveLayer ) GetUorCoverParameter()
        {
            double basicsLength = this.basicConstructor.BasicsLength / 100;
            double leftLateralAngle = this.basicConstructor.LeftLateralAngle;
            double rightLateralAngle = this.basicConstructor.RightLateralAngle;
            double culvertGapWidth = this.basicConstructor.CulvertGapWidth / 100;
            double baseGapWidth = this.basicConstructor.BaseGapWidth / 100;
            double baseSlope = this.basicConstructor.CulvertBaseSlope / 100;
            double clearSpan = this.basicConstructor.ClearSpan;
            double clearHeight = this.basicConstructor.ClearHeight;
            double piecePly = this.basicConstructor.PiecePly / 100;
            double basicsEdge = this.basicConstructor.BasicsEdge / 100;
            double standPly = this.basicConstructor.StandPly / 100;
            double basicsWidth = this.basicConstructor.BasicWidth / 100;    
            double standTopWidth = this.basicConstructor.StandTopWidth / 100;
            double basicsPly = this.basicConstructor.BasicsPly / 100;
            double protectiveLayer = this.basicConstructor.ProtectiveLayer;
            return (basicsLength, leftLateralAngle, rightLateralAngle, culvertGapWidth, baseGapWidth, baseSlope, clearSpan, clearHeight, piecePly, basicsEdge, standPly, basicsWidth,standTopWidth, basicsPly, protectiveLayer);
        }


        public override void CreateElementECProperty(Element element, List<Tuple<string, CustomProperty.TypeKind, bool, bool>> tuples)
        {
            throw new NotImplementedException();
        }


        public override List<(string standardName, string standValue)> CreateStandardECProperty()
        {
            throw new NotImplementedException();
        }

        public override double GetVolumeOfElement(Element element)
        {
            throw new NotImplementedException();
        }

        public override void SaveStandardECProperty(IDgnECInstance dgnECInstanc)
        {
            throw new NotImplementedException();
        }

        public override void SetECInstanceValue(IDgnECInstance dgnECInstance, List<(string propertyName, string calculationBasis, string computationalFormula)> propertyData)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// 基于dPoint3D点沿X轴绘制线
        /// </summary>
        /// <param name="boxCulvertLength">涵长水平距离</param>
        /// <param name="slop">坡度; (例如0.1就是10%的坡率)</param>
        /// <returns></returns>
        public LineElement GetSlopLinee(DPoint3d dPoint3D, double boxCulvertLength, double slop, out DPoint3d endPt)
        {
            double z = boxCulvertLength * slop;
            endPt = new DPoint3d(dPoint3D.X + boxCulvertLength, dPoint3D.Y, dPoint3D.Z + z) * GeneralBank.UorToMeters;
            return new LineElement(GeneralBank.ActiveDgnModel, null, new DSegment3d(dPoint3D * GeneralBank.UorToMeters, new DPoint3d(dPoint3D.X + boxCulvertLength, dPoint3D.Y, dPoint3D.Z + z) * GeneralBank.UorToMeters));
        }

        public SolidKernelEntity CreateBodyFromSweep(CurveVector pathCur, CurveVector secCur, DgnModel modelRef)
        {
            pathCur.GetStartEnd(out DPoint3d startPt, out _, out DVector3d startTangent, out _);
            CurveVector secCur1 = secCur.Clone();
            BCIMNETGS.SolidUtil.Create.BodyFromSweep(out SolidKernelEntity entity, secCur1, pathCur, modelRef, false, true, false, null, null, null, null);
            return entity;
        }
    }
}
